package com.neuedu.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Para {
    static Properties p=new Properties();
    static {
    	try {
			/*InputStream is=new FileInputStream(new File("src/db.properties"));*/
    		//Para.class:得到类类对象，
    		//Para.class.getClassLoader(),通过类类对象得到类加载器
    		//Para.class.getClassLoader().getResourceAsStream:通过类加载器实现资源（文件）生产输入流对象
    		InputStream is=Para.class.getClassLoader().getResourceAsStream("db.properties");
			p.load(is);
		} catch (FileNotFoundException e) {
			
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
    }
    
    public static final String DRIVER=p.getProperty("driver");
    public static final String URL=p.getProperty("url");
    public static final String USERNAME=p.getProperty("usename");
    public static final String PASSWORD=p.getProperty("password");
}
